#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
-#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtkcelllayout.h"
#include "gtkcellrenderertext.h"
#include "gtkentryprivate.h"
-#include "gtkfilesystemmodel.h"
+#include "gtkfilechooserutils.h"
#include "gtklabel.h"
#include "gtkmain.h"
#include "gtksizerequest.h"
#ifndef __GTK_FILE_CHOOSER_ENTRY_H__
#define __GTK_FILE_CHOOSER_ENTRY_H__
-#include "gtkfilesystem.h"
#include "gtkfilechooser.h"
G_BEGIN_DECLS
#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
-#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
-#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
-#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
-#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
{
return gtk_file_chooser_get_choice (get_delegate (chooser), id);
}
+
+gboolean
+_gtk_file_info_consider_as_directory (GFileInfo *info)
+{
+ GFileType type = g_file_info_get_file_type (info);
+
+ return (type == G_FILE_TYPE_DIRECTORY ||
+ type == G_FILE_TYPE_MOUNTABLE ||
+ type == G_FILE_TYPE_SHORTCUT);
+}
+
+gboolean
+_gtk_file_has_native_path (GFile *file)
+{
+ char *local_file_path;
+ gboolean has_native_path;
+
+ /* Don't use g_file_is_native(), as we want to support FUSE paths if available */
+ local_file_path = g_file_get_path (file);
+ has_native_path = (local_file_path != NULL);
+ g_free (local_file_path);
+
+ return has_native_path;
+}
+
+gboolean
+_gtk_file_consider_as_remote (GFile *file)
+{
+ GFileInfo *info;
+ gboolean is_remote;
+
+ info = g_file_query_filesystem_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, NULL, NULL);
+ if (info)
+ {
+ is_remote = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE);
+
+ g_object_unref (info);
+ }
+ else
+ is_remote = FALSE;
+
+ return is_remote;
+}
+
+GIcon *
+_gtk_file_info_get_icon (GFileInfo *info,
+ int icon_size,
+ int scale)
+{
+ GIcon *icon;
+ GdkPixbuf *pixbuf;
+ const gchar *thumbnail_path;
+
+ thumbnail_path = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
+
+ if (thumbnail_path)
+ {
+ pixbuf = gdk_pixbuf_new_from_file_at_size (thumbnail_path,
+ icon_size*scale, icon_size*scale,
+ NULL);
+
+ if (pixbuf != NULL)
+ return G_ICON (pixbuf);
+ }
+
+ icon = g_file_info_get_icon (info);
+ if (icon)
+ return g_object_ref (icon);
+
+ /* Use general fallback for all files without icon */
+ icon = g_themed_icon_new ("text-x-generic");
+ return icon;
+}
gchar * _gtk_file_chooser_label_for_file (GFile *file);
+gboolean _gtk_file_info_consider_as_directory (GFileInfo *info);
+gboolean _gtk_file_has_native_path (GFile *file);
+gboolean _gtk_file_consider_as_remote (GFile *file);
+GIcon * _gtk_file_info_get_icon (GFileInfo *info,
+ int icon_size,
+ int scale);
+
G_END_DECLS
#endif /* __GTK_FILE_CHOOSER_UTILS_H__ */
G_IS_DRIVE (volume))
g_object_unref (volume);
}
-
-/* GFileInfo helper functions */
-GIcon *
-_gtk_file_info_get_icon (GFileInfo *info,
- int icon_size,
- int scale)
-{
- GIcon *icon;
- GdkPixbuf *pixbuf;
- const gchar *thumbnail_path;
-
- thumbnail_path = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
-
- if (thumbnail_path)
- {
- pixbuf = gdk_pixbuf_new_from_file_at_size (thumbnail_path,
- icon_size*scale, icon_size*scale,
- NULL);
-
- if (pixbuf != NULL)
- return G_ICON (pixbuf);
- }
-
- icon = g_file_info_get_icon (info);
- if (icon)
- return g_object_ref (icon);
-
- /* Use general fallback for all files without icon */
- icon = g_themed_icon_new ("text-x-generic");
- return icon;
-}
-
-gboolean
-_gtk_file_info_consider_as_directory (GFileInfo *info)
-{
- GFileType type = g_file_info_get_file_type (info);
-
- return (type == G_FILE_TYPE_DIRECTORY ||
- type == G_FILE_TYPE_MOUNTABLE ||
- type == G_FILE_TYPE_SHORTCUT);
-}
-
-gboolean
-_gtk_file_has_native_path (GFile *file)
-{
- char *local_file_path;
- gboolean has_native_path;
-
- /* Don't use g_file_is_native(), as we want to support FUSE paths if available */
- local_file_path = g_file_get_path (file);
- has_native_path = (local_file_path != NULL);
- g_free (local_file_path);
-
- return has_native_path;
-}
-
-gboolean
-_gtk_file_consider_as_remote (GFile *file)
-{
- GFileInfo *info;
- gboolean is_remote;
-
- info = g_file_query_filesystem_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, NULL, NULL);
- if (info)
- {
- is_remote = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE);
-
- g_object_unref (info);
- }
- else
- is_remote = FALSE;
-
- return is_remote;
-}
GtkFileSystemVolume *_gtk_file_system_volume_ref (GtkFileSystemVolume *volume);
void _gtk_file_system_volume_unref (GtkFileSystemVolume *volume);
-/* GFileInfo helper functions */
-GIcon * _gtk_file_info_get_icon (GFileInfo *info,
- int icon_size,
- int scale);
-
-gboolean _gtk_file_info_consider_as_directory (GFileInfo *info);
-
-/* GFile helper functions */
-gboolean _gtk_file_has_native_path (GFile *file);
-
-gboolean _gtk_file_consider_as_remote (GFile *file);
-
G_END_DECLS
#endif /* __GTK_FILE_SYSTEM_H__ */
+
#include <stdlib.h>
#include <string.h>
-#include "gtkfilesystem.h"
+#include "gtkfilechooserutils.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtktreedatalist.h"
#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
-#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gdk/gdkkeysyms.h"
#include "gtkbookmarksmanagerprivate.h"
#include "gtkcelllayout.h"
-#include "gtkfilesystem.h"
+#include "gtkfilechooserutils.h"
#include "gtkicontheme.h"
#include "gtkintl.h"
#include "gtkmain.h"